package org.codefinger.dao.impl.sql;

import org.codefinger.dao.impl.Querier;
import org.codefinger.dao.impl.SQLVisitor;

public class UnionItem {

	private Querier	querier;

	private String	preffix;

	public UnionItem(Querier querier, boolean isUnionAll) {
		super();
		this.querier = querier;
		this.preffix = isUnionAll ? " UNION ALL " : " UNION ";
	}

	public void visit(SQLVisitor visitor) {
		visitor.appendSQL(preffix);
		querier.visitAsQuery(visitor);
	}

}
